package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.Goods;
import com.atguigu.jxc.entity.Unit;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @description 商品信息
 */
public interface GoodsDao {


    String getMaxCode();


    List<Goods> getListInventory(@Param("rows") Integer rows,@Param("goodsTypeId") Integer goodsTypeId,@Param("codeOrName") String codeOrName,@Param("offSet") int offSet);

    List<Unit> list();

    List<Goods> goodsList(@Param("offset") int offSet,@Param("rows") Integer rows,@Param("goodsName") String goodsName,@Param("goodsTypeId") Integer goodsTypeId);

    int update(Goods goods);

    int save(Goods goods);

    int delete(Integer goodsId);

    List<Goods> getNoInventoryQuantity(@Param("offset") int offSet,@Param("rows") Integer rows,@Param("nameOrCode") String nameOrCode);

    List<Goods> getHasInventoryQuantity(@Param("offset") int offSet,@Param("rows") Integer rows,@Param("nameOrCode") String nameOrCode);

    int updateStock(@Param("goodsId") Integer goodsId,@Param("inventoryQuantity") Integer inventoryQuantity,@Param("purchasingPrice") double purchasingPrice);

    int saveStock(@Param("goodsId") Integer goodsId,@Param("inventoryQuantity") Integer inventoryQuantity,@Param("purchasingPrice") double purchasingPrice);

    int deleteStock(Integer goodsId);


    List<Goods> listAlarm();
}
